% clustering using multiplicative NMF
% A : each row is a sample
% varargin : parameter for multiplicative NMF
% 'k'               : number of cluster
% 'column'          : true for column-wise data
function cluster = multiplicativeNMFClustering(A, varargin)
    par.k = 5;
    par.column = false;
    par = process_parameter(par, varargin{:});
    
    if ~par.column
        [W,H] = multiplicativeNMF(A,  varargin{:}, 'k', par.k, 'basis', 'H');
    else
        [W,H] = multiplicativeNMF(A', varargin{:}, 'k', par.k, 'basis', 'H');
    end
    
    [~, cluster] = max(W, [], 2);
end
